package com.maxd.model;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.SuperBuilder;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.Date;

/**
 * 班级信息
 */
@Entity
@Getter
@Setter
@ToString
@SuperBuilder
@ApiModel("班级信息")
@NoArgsConstructor
@DynamicInsert
@DynamicUpdate
@Table(name = "class_info")
public class ClassInfo implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id
    @ApiModelProperty("自增主键")
    @Column(name = "id", nullable = false)
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    @ApiModelProperty("班级名称")
    @Column(name = "name", nullable = false)
    @NotBlank(message = "班级名称不能为空")
    private String name;

    @ApiModelProperty("简介")
    @Column(name = "introduction")
    @NotBlank(message = "简介不能为空")
    private String introduction;

    @ApiModelProperty("教官ID")
    @Column(name = "instructor_id")
    private Long instructorId;

    @ApiModelProperty("教官用户ID")
    @Column(name = "instructor_user_id")
    private Long instructorUserId;

    @ApiModelProperty("小区主理人ID")
    @Column(name = "assistant_id")
    private Long assistantId;

    @ApiModelProperty("小区主理人用户ID")
    @Column(name = "assistant_user_id")
    private Long assistantUserId;

    @ApiModelProperty("备注")
    @Column(name = "remark")
    private String remark;

    @ApiModelProperty("创建时间")
    @Column(name = "create_time", nullable = false)
    private Date createTime;

    @ApiModelProperty("更新时间")
    @Column(name = "update_time", nullable = false)
    private Date updateTime;

    @ApiModelProperty("创建人")
    @Column(name = "create_by")
    private String createBy;

    @ApiModelProperty("更新人")
    @Column(name = "update_by")
    private String updateBy;

}
